package com.cn.xiaonuo.tcrfinance.tcrorder.controller;

import com.cn.xiaonuo.common.entity.BusinessMessage;
import com.cn.xiaonuo.tcrfinance.tcrorder.param.PvBuySellOrderParam;
import com.cn.xiaonuo.tcrfinance.tcrorder.param.PvOrderParam;
import com.cn.xiaonuo.tcrfinance.tcrorder.service.PvOrderService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 订单
 *
 * @author Mark sunlightcs@gmail.com
 */
@RestController
public class OrderController {

    @Autowired
    private PvOrderService pvOrderService;


    /**
     * 上票
     */
    @PostMapping("/api/order/ticketUp")
    public BusinessMessage ticketUp(@RequestBody PvOrderParam pvOrderParam){
        BusinessMessage message = pvOrderService.ticketUp(pvOrderParam);
        return message;
    }

    /**
     * 买卖交易记录
     * @param pvBuySellOrderParam
     * @return
     */
    @ApiOperation(value = "买卖交易记录", notes = "交易记录")
    @PostMapping(value = "/api/order/selectAllTradeDetail")
    public BusinessMessage selectAllTradeDetail(PvBuySellOrderParam pvBuySellOrderParam) {
        BusinessMessage message = pvOrderService.selectAllTradeDetail(pvBuySellOrderParam);
        return message;
    }

    /**
     * 促销活动记录
     * @param pvBuySellOrderParam
     * @return
     */
    @ApiOperation(value = "促销活动记录", notes = "促销活动记录")
    @PostMapping(value = "/api/order/activitiesList")
    public BusinessMessage activitiesList(@RequestBody PvBuySellOrderParam pvBuySellOrderParam) {
        BusinessMessage message = pvOrderService.activitiesList(pvBuySellOrderParam);
        return message;
    }
}
